package top.jiangqiang.qyblog.core.service;

import top.jiangqiang.qyblog.common.base.query.PageResult;
import top.jiangqiang.qyblog.common.base.response.Result;
import top.jiangqiang.qyblog.core.base.service.BaseService;
import top.jiangqiang.qyblog.core.domain.dto.ArticleQueryDto;
import top.jiangqiang.qyblog.core.domain.dto.ArticleSaveOrUpdateDto;
import top.jiangqiang.qyblog.core.domain.dto.ArticleSettingDto;
import top.jiangqiang.qyblog.core.domain.entity.Article;
import top.jiangqiang.qyblog.core.domain.vo.ArticleVo;

/**
 * <p>
 * 文章 服务类
 * </p>
 *
 * @author JiangQiang
 * @since 2023-05-29
 */
public interface IArticleService extends BaseService<Article> {

    /**
     * 根据文章标题和文章状态进行筛选
     *
     * @param articleQueryDto 文章查询参数
     * @return
     */
    Result<PageResult<ArticleVo>> findByCondition(ArticleQueryDto articleQueryDto);

    /**
     * 查询文章详情
     *
     * @param id 文章id
     * @return
     */
    Result<ArticleVo> getArticleById(Long id);

    /**
     * 根据id删除文章，同时删除关联关系
     *
     * @param id 文章id
     * @return
     */
    boolean deleteArticleById(Long id);

    Result<ArticleVo> saveOrUpdateArticle(ArticleSaveOrUpdateDto articleSaveOrUpdateDto);

    Result<ArticleVo> setting(ArticleSettingDto articleSettingDto);
}
